package com.lange.autocode.menuCounter;

import cn.net.autocode.core.utils.UserThreadLocalUtils;
import cn.net.autocode.dbManager.Dao;
import cn.net.autocode.platform.menus.MenuAnnotation;
import cn.net.autocode.platform.menus.MenuCounter;
import org.springframework.stereotype.Component;

@MenuAnnotation("pmApproveCounter")
@Component
public class PmApproveCounter implements MenuCounter {
    private final Dao dao;

    public PmApproveCounter(Dao dao) {
        this.dao = dao;
    }

    @Override
    public int counter() {
        return dao.queryValue("select count(*) from pm_projects where org_code=? and status='Approve'",Integer.class, UserThreadLocalUtils.getOrgCode());
    }
}
